package org.ddevil.data;

import java.util.Comparator;

/**
 * This class will compare string lexicographically. For example: 
 * 1. 1111111
 * 2. 21
 * 3. 8
 * <table width = 100% border=1>
 * <tr>
 * <td colspan="3" align="center"><strong>History</strong></td>
 * </tr>
 * <tr>
 * <th>Date</th>
 * <th>Name</th>
 * <th>Desc</th>
 * </tr>
 * </table>
 * @author Eric Lundin
 *
 */
public class StringLexicographicComparator implements Comparator {

	/**
	 * Create a new Lexicographic Comparator
	 */
	public StringLexicographicComparator() {
		super();
	}

	/* (non-Javadoc)
	 * @see java.util.Comparator#compare(T, T)
	 */
	public int compare(Object o1, Object o2) {
		String string1 = (String)o1;
		String string2 = (String)o2;
		return string1.compareTo(string2);
	}
}
